package com.it.controller;

import com.it.dto.UserAuthDTO;
import com.it.result.R;
import com.it.service.ISysUserService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/api/v1/users")
@Slf4j
@RequiredArgsConstructor
public class UserController {
   private final ISysUserService iSysUserService;
   /**
   * 获取⽤户信息
   */
   @GetMapping("/username/{username}")
   public R<UserAuthDTO> getUserByUsername(@PathVariable String username) {
      UserAuthDTO user = iSysUserService.getByUsername(username);
      return R.ok(user);
   }
}